<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Cp1252">
<title>Insert title here</title>
<script type='text/javascript' src='dwr/engine.js'> </script>
<script type='text/javascript' src='dwr/util.js'> </script>
<script type='text/javascript' src='dwr/interface/GameCenter.js'> </script>
<script type='text/javascript' src='dwr/interface/HostService.js'> </script>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?2.8.0r4/build/datatable/assets/skins/sam/datatable.css"> 
<!-- Combo-handled YUI JS files: --> 
<script type="text/javascript" src="http://yui.yahooapis.com/combo?2.8.0r4/build/yahoo-dom-event/yahoo-dom-event.js&2.8.0r4/build/dragdrop/dragdrop-min.js&2.8.0r4/build/element/element-min.js&2.8.0r4/build/datasource/datasource-min.js&2.8.0r4/build/datatable/datatable-min.js"></script> 

<script type="text/javascript">

function initTestPage() {
	HostService.initTestPage();
	
}

function showUserScore(userList,currUser) {
	alert("User Score");
	var rooms = new Array();
	var scoreLink = '<input type="button" value="score" onclick="doScore()"/>';
	document.getElementById('button').innerHTML=scoreLink;
	for(var i=0;i<userList.length; i++){
		
		rooms[i] = {'userName':userList[i].name ,'score':userList[i].score }
		//rooms[i] = {'roomName:'+roomList[i].roomName +'",'+'noOfUsers:"'+noOfUsers +'",'+'state:"'+roomList[i].roomState+'"'}
	}
	
	var myColumnDefs = [ 
	            {key:"userName", label:"User Name", sortable:true, resizeable:true}, 
	            {key:"score",label:"Score", sortable:true, resizeable:true}
	        ]; 

	 myDataSource = new YAHOO.util.DataSource(rooms); 
	 myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY; 
		        myDataSource.responseSchema = { 
		            fields: ["userName","score"] 
		        }; 
		 
		        var myDataTable = new YAHOO.widget.DataTable("user_result", 
		                myColumnDefs, myDataSource, {caption:"Users List"}); 
		                 
		        return { 
		            oDS: myDataSource, 
		            oDT: myDataTable 
		        }; 
}

function doScore() {
	HostService.doScore();
}
</script>
</head>
<body onload="dwr.engine.setActiveReverseAjax(true);initTestPage()">
	<div id ="user_result">
		
	</div>
	<div id="button"></div>
</body>
</html>